
import request from '@/utils/request';
import { ResultUser } from './definitions/ResultUser';
import { User } from './definitions/User';
import { ResultListUser } from './definitions/ResultListUser';
import { ResultUserResponseEntity } from './definitions/ResultUserResponseEntity';
import { UserRequestEntity } from './definitions/UserRequestEntity';
import { Result } from './definitions/Result';


export class UserAdminController {

    static addUsingPOSTPath: string = "/v1/admin/user";
    /// 新增用户
    async addUsingPOST(data: User, headers?: any):  Promise<ResultUser> {
      return request(`/v1/admin/user`, {
        method: "POST",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static updateUsingPUTPath: string = "/v1/admin/user";
    /// 更新用户
    async updateUsingPUT(data: User, headers?: any):  Promise<ResultUser> {
      return request(`/v1/admin/user`, {
        method: "PUT",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static listUsingPOSTPath: string = "/v1/admin/user/list";
    /// 查询列表
    async listUsingPOST(data: User, headers?: any):  Promise<ResultListUser> {
      return request(`/v1/admin/user/list`, {
        method: "POST",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static listByMobileUsingGETPath: string = "/v1/admin/user/listByMobile";

    async listByMobileUsingGET( headers?: any) : Promise<ResultListUser> {
      return request(`/v1/admin/user/listByMobile`, {
        method: "GET",
        headers: headers,
      }) as Promise<any>;
    }
    
    static pageUsingPOSTPath: string = "/v1/admin/user/page";
    /// 查询分页
    async pageUsingPOST(data: UserRequestEntity, headers?: any):  Promise<ResultUserResponseEntity> {
      return request(`/v1/admin/user/page`, {
        method: "POST",
        data: JSON.stringify(data) ,
        headers: headers,
      }) as Promise<any>;
    }
    
    static detailUsingGETPath: string = "/v1/admin/user/{id}";

    async detailUsingGET(id: string,  headers?: any) : Promise<any> {
      return request(`/v1/admin/user/${id}`, {
        method: "GET",
        headers: headers,
      }) as Promise<any>;
    }
    
    static deleteUsingDELETEPath: string = "/v1/admin/user/{id}";

    async deleteUsingDELETE(id: string,  headers?: any) : Promise<any> {
      return request(`/v1/admin/user/${id}`, {
        method: "DELETE",
        headers: headers,
      }) as Promise<any>;
    }
    
}